﻿@using KRM.Core
@model KRM.Core.tblOrder
@{
    ViewBag.Title = "Refund Tesco Order";
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
    IEnumerable<VTescoOrderRefund> tescoRefunds = ViewBag.TescoRefunds;
}
<script>
    $(document).ready(function() {
        $(".tbl-tescorefund tbody tr:first-child").trigger("click");
    })
</script>
<div style="padding: 10px">
    <div class="row-fluid">
        <div class="span1">OrderRef</div>
        <div class="span3">
            <input type="text" class="input-block-level" disabled="disabled" value="@Model.OrderRef"/>
        </div>
        <div class="span2 text-right">TradeOrderRef</div>
        <div class="span3">
            <input type="text" class="input-block-level" id="tradeorderref" disabled="disabled" value="@Model.TradeOrder.TradeOrderRef"/>
        </div>
    </div>
    <div style="height: 300px; overflow: auto; margin: 10px 0 20px" class="border-padding10">
        <table class="table table-bordered table-fix tbl-selected tbl-tescorefund">
            <thead>
                <tr>
                    <th>IsRefunded</th>
                    <th>RefundDate</th>
                    <th>OrderItemID</th>
                    <th>ItemPrice</th>
                    <th>ItemQty</th>
                    <th>OrderLineNumber</th>
                    <th>ProductName</th>
                    <th>ProductOption</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in tescoRefunds)
                {
                    <tr onclick="tescorefundselected('@item.OrderItemID', '@Model.OrderID')">
                        <td style="text-align: center">
                            <input type="checkbox" disabled="disabled" @(item.IsRefunded == true ? "checked=checked" : "") /></td>
                        <td>@item.DateReturn</td>
                        <td>@item.OrderItemID</td>
                        <td>@item.ItemPrice</td>
                        <td>@item.ItemQty</td>
                        <td>@item.OrderLineNumber</td>
                        <td>@item.ProductName</td>
                        <td>@item.ProductOption</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <form class="margin0 refundtescodetail" method="POST" id="fr-refundtescoorder">
    </form>
</div>
